/*
 * @lc app=leetcode.cn id=242 lang=javascript
 *
 * [242] 有效的字母异位词
 */

// @lc code=start
/**
 * @param {string} s
 * @param {string} t
 * @return {boolean}
 */
var isAnagram = function (s, t) {
  if (s.length !== t.length) return false;

  const ssort = Array.from(s).sort();
  const tsort = Array.from(t).sort();

  return ssort.join('') === tsort.join('');
};
// @lc code=end

// @after-stub-for-debug-begin
module.exports = isAnagram;
// @after-stub-for-debug-end
